package com.youngjun.user.api;

import com.youngjun.common.mybatis.web.Response;
import com.youngjun.user.pojo.vo.DocumentVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "用户管理")
@FeignClient(
        name = "${ums.api.name:ums-service}",
        contextId = "documentRestApi",
        url  = "${ums.api.url:http://127.0.0.1:8080}",
        path = "/document"
)
public interface IDocumentRestApi {

    @ApiOperation(value = "上传文件")
    @RequestMapping(path = "/upload",method = RequestMethod.POST)
    Response<DocumentVO> upload(@RequestParam("file") MultipartFile file);

    @ApiOperation(value = "下载文件")
    @RequestMapping(value = "/download",method = RequestMethod.GET)
    void download(@RequestParam String id);

}